/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package inventory;

/**
 *
 * @author Mark King
 */
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.Timer;


public final class Driver extends WindowSize2{
    
    private dbConnector connector = new dbConnector();
    WindowSize2 window = new WindowSize2();
    
    
    public Driver()
    {
        connector.connect();
        final JFrame logInFrame = new JFrame("Log In");
        final LogInUI login = new LogInUI(connector.getConnector(), window.screenWidth, window.screenHeight);
        logInFrame.add(login);
        logInFrame.setSize(login.getWidth(), login.getHeight());
        logInFrame.setLocation((window.screenWidth-login.getWidth()) /2, (window.screenHeight-login.getHeight())/2);
        logInFrame.setResizable(false);
        logInFrame.setVisible(true);
        
        ActionListener actionListener = new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            if(login.getVerify() == true){
                logInFrame.dispose();
            }
        }
        };
        Timer timer = new Timer(500, actionListener);
        timer.start();
        
        
       
        
        
    }
    
    
    
 
    
}
